#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>


#include<vector>

using namespace std;

class Solution {
public:
    
        vector<int> a;
        int book[100];
        vector<vector<int>> res;


        void DFS(int cur, vector<int>&nums)
        {
            if (cur == nums.size())
            {
                res.push_back(a);
            }
            for (int i = 0; i < nums.size(); i++)
            {
                if (!book[nums[i] + 20])
                {
                    a.push_back(nums[i]);
                    book[nums[i] + 20] = 1;
                    DFS(cur + 1, nums);
                    book[nums[i] + 20] = 0;
                    a.pop_back();
                }
            }
        }
       
            
       
    vector<vector<int>> permute(vector<int>& nums) {
        DFS(0, nums);
        return res;
    }
};





